﻿package rob.entity{
	import flash.display.Sprite;
	
	public class Floor extends Sprite{
		private var _gfx:Sprite, _x:Number, _y:Number, _angle:Number;
		
		public function Floor(s:Sprite):void{
			_x = s.x;
			_y = s.y;
			_angle = s.rotation;
			_gfx = s;
			s.x = s.y = 0;
		}
		
		// we set dimensions so stage coords correpsonds to world coordinates
		public function setDimensions(k:Number):void{
			// setting rotation = 0 initially is necessary
				_gfx.rotation = 0;
				_gfx.width *= k;
				_gfx.height *= k;
				_gfx.rotation = _angle;
			x = _x * k;
			y = _y * k;
		}
		
		public function get angle():Number{return _angle;}
		public function get gfx():Sprite{return _gfx;}
	}
}